<include file="Public:header" />

<div class="pad-lr-10">
    <form id="myform" name="myform" action="{:u('brand/delete')}" method="post" onsubmit="return check();">
    <div class="table-list">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
            	<th width=50>{$Think.lang.orders}</th>
                <th width=30 align="center"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
                <th width=80>{$Think.lang.brand_id}</th>
                <th>{$Think.lang.brand_name}</th>
                <th>{$Think.lang.brand_logo}</th>
                <th width=150>{$Think.lang.status}</th>
                <th width=80>{$Think.lang.operations_manage}</th>
            </tr>
        </thead>
    	<tbody>
        <volist name='brand_list' id='val'>
        <tr>
        	<td align="center">{$val.key}</td>
            <td align="center"><input type="checkbox" value="{$val.id}" name="id[]"></td>
            <td align="center">{$val.id}</td>
            <td align="center">{$val.name}</td>
            <td align="center"><img src="__PUBLIC__/Uploads/m_{$val.logo}" style="border: 1px solid #999999;padding:1px;width:100px;height:33px;"/></td>
            <td align="center"><img src="__PUBLIC__/images/status_{$val.status}.gif" /></td>
            <td align="center"><a href="javascript:edit({$val.id},'{$val.name}')">{$Think.lang.edit}</a> | <a href="?m=brand&a=delete&id={$val.id}" onclick="return confirm('<?php echo sprintf(L('confirm_del'),$val['name']);?>')">{$Think.lang.delete}</a></td>
        </tr>
        </volist>
    	</tbody>
    </table>

    <div class="btn">
    <label for="check_box">{$Think.lang.select_all}/{$Think.lang.cancel}</label>
    <input type="submit" class="button" name="dosubmit" value="{$Think.lang.delete}" onclick="return confirm('{$Think.lang.sure_delete}')"/>
    <div id="pages">{$page}</div>
    </div>
    
    </div>
    </form>
</div>
<script type="text/javascript">
var lang_edit = "{$Think.lang.edit}";
function edit(brand_id, name) {
	window.top.art.dialog({id:'edit'}).close();
	window.top.art.dialog({title:lang_edit+'--'+name,id:'edit',iframe:'?m=brand&a=edit&id='+brand_id,width:'500',height:'350'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;d.document.getElementById('dosubmit').click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}

function check(){
	var lang_select = "{$Think.lang.please_select}";
	var lang_name = "{$Think.lang.brand_name}";
	if($("#myform").attr('action') != '{:u("brand/delete")}') {
		var ids='';
		$("input[name='id[]']:checked").each(function(i, n){
			ids += $(n).val() + ',';
		});

		if(ids=='') {
			window.top.art.dialog({content:lang_select+'--'+lang_name,lock:true,width:'200',height:'50',time:1.5},function(){});
			return false;
		}
	}
	return true;
}
</script>
</body>
</html>

